<script setup>
import { onMounted } from 'vue';
import TheWelcome from '../components/TheWelcome.vue';
import axios from "axios";
import { useCounterStore } from '@/stores/counter';
const counterStore=useCounterStore();

const test=function(){
  console.log("====")
  //https://link.csdn.net/?from_id=127978329&target=https%3A%2F%2Frestapi.amap.com%2Fv3%2Fweather%2FweatherInfo%3Fcity%3D110101%26key%3D
  
  //https://restapi.amap.com/v3/weather/weatherInfo?city=110101&key=b326668efca294931bbb5cba6d8fa51d
  // b326668efca294931bbb5cba6d8fa51d
  axios.get("/api/posts").then(res=>{
    console.log(res)
  }).catch(err=>{
    console.log(err)
  })
};


onMounted(()=>{
  console.log("----->")
  test();
});



</script>

<template>
  <!-- <main> -->
    <!-- <TheWelcome /> -->

  <!-- </main> -->
   <div style="width: 400px;height:400px;background: #c9c9c9;">
    123
    <div>{{counterStore.doubleCount}}</div>
   </div>
</template>
